# It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Desktop Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script to add a Mac to a domain # Configuration Type - COMPUTER # !/usr/bin/bash # Kindly replace the domain, computer name, username and OU. # Example: dsconfigad -add com.zohocorp.in -computer comp-1 -username john -ou # "CN=Computers,OU=Engineering,DC=ads,DC=example,DC=com" dsconfigad -add -computer -username "administrator" -ou "CN=Computers,OU=Engineering,DC=ads,DC=example,DC=com" errcode=$? if [ "$errcode" -ne 0 ]; then echo "" echo "Failed to apply with errorcode $errcode" 1>&2 echo "" exit 1 fi echo "Mac machine added to domain successfully" 1>&2